package co.msk8.shared;

public enum Operation {

	ADDITION("+"),
	SUBSTRACTION("-"),
	MULTIPLICATION("*"),
	DIVISION("/"),
	EQUALS("="),
	;
	
	private String symbol;
	
	
	public String getSymbol() {
		return symbol;
	}


	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}


	private Operation(String symbol) {
		
		this.symbol = symbol;
	}


	public static Operation getOperationBySymbol(String symbol) {
		
		for (Operation actual : values()) {
			
			if (actual.getSymbol().equals(symbol)) {
				return actual;
			}
		}
		throw new IllegalArgumentException("Symbol not recognized " + symbol);
	}
	
}